package com.dukang.notes.controller

import com.dukang.notes.service.UserServiceImpl
import org.apache.catalina.User
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.ResponseBody
import org.springframework.web.bind.annotation.RestController
import javax.annotation.Resource

/**
 * 测试控制器
 */

@RestController
class HelloController {

    @Resource
    lateinit var userServiceImpl: UserServiceImpl

    @RequestMapping("/hello")
    @ResponseBody
    fun hello():String{

        val list = userServiceImpl.getAll()


//        return "hello Spring Boot，my name is 王杜康"
        return list.toString()
    }

    @RequestMapping("/getUser")
    fun getUserById():String{
        val userById = userServiceImpl.getUserById("100000000000001")
        return userById.toString()
    }
}